<?xml version="1.0" encoding="UTF-8" ?>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>/mobile/bud/budReceiveRequest.jsp</title>

	<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"> 

	<LINK href="${cPath }/css/bud.css"  rel="stylesheet"  type="text/css"/>
	<script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
	<SCRIPT type="text/javascript">
		$(document).on("mobileinit", function(){
			$.mobile.ajaxEnabled = false;
		});
	
// 		function receiveBud(mem_no, mem_name){
// 			var result = confirm(mem_name+"님을 벗으로 등록하겠습니까?");
// 			if (result==true){
// 				location.href = "${cPath }/bud/budReceiveRequestBud.mo?mem_no=" + mem_no;
// 			}
// 		}
	</SCRIPT>
	<script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script>

</head>
<body>
<div id="budReceiveRequest" data-role="page" data-theme="b">

	<div data-role="header" data-position="fixed" data-theme="a">
		<div style="left:5px; top:5px; z-index:10001;position:fixed;" >
			<img src="${cPath }/css/webbud.png" height="30px" />
		</div>
		<a href="${cPath }/logout.mo" id="back" data-icon="custom" class="ui-btn-right">로그아웃</a>
		<h1>받은 벗요청</h1>
		<div data-role="navbar" data-iconpos="top" >
			<ul>
				<li><a href="${cPath }/scan/scanMap.mo" id="scan" data-icon="custom" >Scan</a></li>
				<li><a href="${cPath }/bud/budList.mo" id="bud" class="ui-btn-active" data-icon="custom" >Bud</a></li>
				<li><a href="${cPath }/chat/chatList.mo" id="chat" data-icon="custom">Chat</a></li>
				<li><a href="${cPath }/settings/setMain.mo" id="set" data-icon="custom">Settings</a></li>
			</ul>
		</div>
		
	</div>

	<div data-role="content" >
		<ul data-role="listview" data-inset="true" data-filter="true" data-split-icon="custom" id="enter" data-split-theme="d">
			<li data-role="list-divider">
				<LABEL>친구</LABEL>
				<LABEL style="float:right;">수락</LABEL>
			</li>
			<c:if test="${empty friendList }"><li>받은신청이 없습니다</li></c:if>
			<c:forEach var="friend" items="${friendList }">
				<li><a href="${cPath }/scan/scanProfilePeople.mo?mem_no=${friend.mem_no}">
					<c:if test="${!empty friend.mem_photoStr }">
						<img src="data:image/jpeg;base64, ${friend.mem_photoStr }" />
					</c:if>
					<c:if test="${empty friend.mem_photoStr }">
						<img src="${cPath }/css/images/budlogo.png" />
					</c:if>
					<h3>${friend.mem_name }</h3>
					<p>${friend.mem_message }</p></a>
					<a href="#popupDialog" data-rel="popup" data-position-to="window" data-transition="pop">수락</a>
				</li>
				
	<div data-role="popup" id="popupDialog" data-overlay-theme="b"  style="max-width:300px;" class="ui-corner-all">
		<div data-role="content" data-theme="d" class="ui-corner-bottom ui-content">
			<h3 class="ui-title">정말로 내 벗으로 등록하시겠습니까?</h3>
			<a href="${cPath }/bud/budReceiveRequestBud.mo?mem_no=${friend.mem_no }" data-role="button" data-inline="true" data-theme="a">수락</a>    
			<a href="${cPath }/bud/budReceiveRequestBudReject.mo?mem_no=${friend.mem_no }" data-role="button" data-inline="true" data-theme="b">거부</a>
<!-- 			<a href="#" data-role="button" data-inline="true" data-rel="back" data-transition="flow" data-theme="b">취소</a>   -->
		</div>
	</div>
			</c:forEach>
		</ul>
	</div>

	<div data-role="footer" data-position="fixed" data-theme="a">		
		<div data-role="navbar">
			<ul>
				<li><a href="${cPath }/bud/budList.mo" >내벗</a></li>
				<li><a href="${cPath }/bud/budSearch.mo" >벗찾기</a></li>
				<li><a href="#" class="ui-btn-active">받은신청</a></li>
			</ul>
		</div>
	</div>
	
	<a href="#popupMsg" data-rel="popup" id="msg" hidden="true" data-position-to="window" data-transition="pop"></a>
	<div data-role="popup" id="popupMsg" data-overlay-theme="a" style="max-width:400px;" class="ui-corner-all">
		<div data-role="content" data-theme="d" class="ui-corner-bottom ui-content">
			<h3 class="ui-title">${msg }</h3>
		</div>
	</div>
	<c:if test="${!empty msg }">
		<script>
			$(function(){
				$("#msg").trigger("click");
			});
		</script>
	</c:if>

	
</div><!-- /page -->
</body>
</html>